{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "\n",
    "def delete_files(target_dir, file_ends, level=2):\n",
    "    for dirpath, dirnames, filenames in os.walk(target_dir):\n",
    "        cur_level = dirpath.count(os.sep) - target_dir.count(os.sep)\n",
    "        if cur_level == level:\n",
    "            for filename in filenames:\n",
    "                if any(filename.endswith(end) for end in file_ends):\n",
    "                    file_path = os.path.join(dirpath, filename)\n",
    "                    os.remove(file_path)\n",
    "                    print(f\"Deleted: {file_path}\")\n",
    "\n",
    "\n",
    "target_dir = 'top_300_metrics'\n",
    "file_ends = ['details.json', 'meta.json', 'active_dates_and_times.json', 'detail.json',\n",
    "             'contributor_email_suffixes.json']\n",
    "delete_files(target_dir, file_ends, level=2)\n",
    "\n",
    "import os\n",
    "import json\n",
    "\n",
    "\n",
    "def extract_avg_from_json(target_dir, file_list):\n",
    "    for dirpath, dirnames, filenames in os.walk(target_dir):\n",
    "        for file_name in file_list:\n",
    "            if file_name in filenames:\n",
    "                print(file_name)\n",
    "                old_file_path = os.path.join(dirpath, file_name)\n",
    "                with open(old_file_path, 'r') as f:\n",
    "                    data = json.load(f)\n",
    "                avg_data = data['avg']\n",
    "                new_file_name = file_name.replace('.json', '_avg.json')\n",
    "                new_file_path = os.path.join(dirpath, new_file_name)\n",
    "                with open(new_file_path, 'w') as out_file:\n",
    "                    json.dump(avg_data, out_file)\n",
    "                os.remove(old_file_path)  # 删除源文件\n",
    "                print(\n",
    "                    f\"Extracted 'avg' data from {file_name}, saved to {new_file_name}, and deleted the original file in directory {dirpath}\")\n",
    "\n",
    "\n",
    "target_dir = 'top_300_metrics'\n",
    "file_list = ['change_request_resolution_duration.json', 'change_request_response_time.json',\n",
    "             'issue_resolution_duration.json', 'issue_response_time.json', 'issue_age.json', 'change_request_age.json']\n",
    "\n",
    "extract_avg_from_json(target_dir, file_list)\n",
    "\n",
    "import os\n",
    "import pandas as pd\n",
    "\n",
    "\n",
    "def json_to_csv(target_directory, output_directory):\n",
    "    if not os.path.exists(output_directory):\n",
    "        os.makedirs(output_directory)\n",
    "\n",
    "    main_df_name = 'openrank'\n",
    "\n",
    "    for dirpath, dirnames, filenames in os.walk(target_directory):\n",
    "        dfs = {}  # 将dfs定义移到循环内部，以便每次处理新的子目录时清空dfs\n",
    "        for filename in filenames:\n",
    "            if filename.endswith('.json'):\n",
    "                file_path = os.path.join(dirpath, filename)\n",
    "                data = pd.read_json(file_path, typ='series')\n",
    "\n",
    "                # 将Series转换为DataFrame并重置索引以便将索引作为单独的列添加\n",
    "                df = data.to_frame().reset_index()\n",
    "\n",
    "                # 更改列名\n",
    "                df.columns = ['Date', filename[:-5]]\n",
    "\n",
    "                # 将Date列转换为字符串\n",
    "                df['Date'] = df['Date'].astype(str)\n",
    "\n",
    "                # 清除\"-raw\"\n",
    "                df['Date'] = df['Date'].str.replace('-raw', '')\n",
    "\n",
    "                # 将Date列转换为年-月格式\n",
    "                df['Date'] = pd.to_datetime(df['Date']).dt.to_period('M')\n",
    "\n",
    "                # 删除重复的日期\n",
    "                df = df.drop_duplicates(subset='Date')\n",
    "\n",
    "                # 设置Date为索引\n",
    "                df.set_index('Date', inplace=True)\n",
    "\n",
    "                # 将DataFrame保存为CSV\n",
    "                # csv_file_path = os.path.join(output_directory, filename.replace('.json', '.csv'))\n",
    "                # df.to_csv(csv_file_path)\n",
    "\n",
    "                # 将这个DataFrame添加到字典中，键为文件名\n",
    "                dfs[filename[:-5]] = df\n",
    "\n",
    "        # 如果dfs字典不为空，则合并DataFrame并保存为CSV\n",
    "        if dfs:\n",
    "            main_df = dfs.get(main_df_name)\n",
    "            if main_df is None:\n",
    "                print(f\"File {main_df_name}.json not found\")\n",
    "                return\n",
    "\n",
    "            for name, df in dfs.items():\n",
    "                if name != main_df_name:\n",
    "                    main_df = main_df.join(df, how='left')\n",
    "\n",
    "            # 获取当前子目录的名字\n",
    "            current_subdir = os.path.basename(dirpath)\n",
    "\n",
    "            # 将合并后的DataFrame保存为CSV\n",
    "            main_df.to_csv(os.path.join(output_directory, f'{current_subdir}.csv'))\n",
    "\n",
    "\n",
    "# 调用函数\n",
    "json_to_csv('top_300_metrics', 'out')\n",
    "\n",
    "# 处理out_v1\n",
    "增加上个月数值\n",
    "import os\n",
    "import pandas as pd\n",
    "\n",
    "\n",
    "def json_to_csv(target_directory, output_directory):\n",
    "    if not os.path.exists(output_directory):\n",
    "        os.makedirs(output_directory)\n",
    "\n",
    "    main_df_name = 'openrank'\n",
    "\n",
    "    for dirpath, dirnames, filenames in os.walk(target_directory):\n",
    "        dfs = {}  # 将dfs定义移到循环内部，以便每次处理新的子目录时清空dfs\n",
    "        for filename in filenames:\n",
    "            if filename.endswith('.json'):\n",
    "                file_path = os.path.join(dirpath, filename)\n",
    "                data = pd.read_json(file_path, typ='series')\n",
    "                # 将Series转换为DataFrame并重置索引以便将索引作为单独的列添加\n",
    "                df = data.to_frame().reset_index()\n",
    "\n",
    "                # 更改列名\n",
    "                df.columns = ['Date', filename[:-5]]\n",
    "\n",
    "                # 将Date列转换为字符串\n",
    "                df['Date'] = df['Date'].astype(str)\n",
    "\n",
    "                # 清除\"-raw\"\n",
    "                df['Date'] = df['Date'].str.replace('-raw', '')\n",
    "\n",
    "                # 将Date列转换为年-月格式\n",
    "                df['Date'] = pd.to_datetime(df['Date']).dt.to_period('M')\n",
    "\n",
    "                # 删除重复的日期\n",
    "                df = df.drop_duplicates(subset='Date')\n",
    "\n",
    "                # 设置Date为索引\n",
    "                df.set_index('Date', inplace=True)\n",
    "\n",
    "                # 将DataFrame保存为CSV\n",
    "                # csv_file_path = os.path.join(output_directory, filename.replace('.json', '.csv'))\n",
    "                # df.to_csv(csv_file_path)\n",
    "\n",
    "                # 将这个DataFrame添加到字典中，键为文件名\n",
    "                dfs[filename[:-5]] = df\n",
    "\n",
    "        # 如果dfs字典不为空，则合并DataFrame并保存为CSV\n",
    "        if dfs:\n",
    "            main_df = dfs.get(main_df_name)\n",
    "            if main_df is None:\n",
    "                print(f\"File {main_df_name}.json not found\")\n",
    "                return\n",
    "\n",
    "            for name, df in dfs.items():\n",
    "                if name != main_df_name:\n",
    "                    main_df = main_df.join(df, how='left')\n",
    "\n",
    "            # 获取当前子目录的名字\n",
    "            current_subdir = os.path.basename(dirpath)\n",
    "\n",
    "            # 将合并后的DataFrame保存为CSV\n",
    "            main_df.to_csv(os.path.join(output_directory, f'{current_subdir}.csv'))\n",
    "\n",
    "\n",
    "# 调用函数\n",
    "json_to_csv('top_300_metrics', 'out_v1')\n",
    "\n",
    "import os\n",
    "import pandas as pd\n",
    "\n",
    "\n",
    "def add_last_value(input_directory, output_directory):\n",
    "    if not os.path.exists(output_directory):\n",
    "        os.makedirs(output_directory)\n",
    "\n",
    "    merged_df = None  # 存储合并后的DataFrame\n",
    "\n",
    "    for filename in os.listdir(input_directory):\n",
    "        if filename.endswith('.csv'):\n",
    "            file_path = os.path.join(input_directory, filename)\n",
    "            df = pd.read_csv(file_path)  # 跳过第一行并指定要读取的列\n",
    "            # 从后往前更新除了\"Date\"字段之外的其他字段\n",
    "            for i in range(len(df) - 2, -1, -1):\n",
    "                for column in df.columns:\n",
    "\n",
    "                    if column == 'Date':\n",
    "                        continue\n",
    "                    if column == 'openrank':\n",
    "                        continue\n",
    "                    next_value = df.iloc[i + 1, df.columns.get_loc(column)]  # 获取下一个字段值\n",
    "                    if pd.isnull(next_value):\n",
    "                        next_value = df[column].median()  # 使用中位数填充缺失值\n",
    "                    new_value = next_value * 0.2 + df.iloc[i, df.columns.get_loc(column)]  # 计算新的字段值\n",
    "                    df.loc[i, column] = new_value  # 更新当前行的字段值\n",
    "            #使用一列的中位数填充\n",
    "            df.fillna(df.median(), inplace=True)\n",
    "            if merged_df is None:\n",
    "                merged_df = df\n",
    "            else:\n",
    "                merged_df = pd.concat([merged_df, df], ignore_index=True)  # 合并DataFrame\n",
    "\n",
    "    # 将合并后的DataFrame保存为CSV\n",
    "    merged_csv_path = os.path.join(output_directory, 'merged_data.csv')\n",
    "    merged_df.to_csv(merged_csv_path, index=False)\n",
    "\n",
    "\n",
    "# 调用函数\n",
    "add_last_value('./out_v1', './')\n",
    "\n",
    "### 不同的系数\n",
    "import os\n",
    "import pandas as pd\n",
    "\n",
    "\n",
    "def add_last_value(input_directory, output_directory, coef):\n",
    "    # 用系数创建新的输出目录\n",
    "    output_directory = os.path.join(output_directory, str(coef))\n",
    "    if not os.path.exists(output_directory):\n",
    "        os.makedirs(output_directory)\n",
    "\n",
    "    merged_df = None  # 存储合并后的DataFrame\n",
    "\n",
    "    for filename in os.listdir(input_directory):\n",
    "        if filename.endswith('.csv'):\n",
    "            file_path = os.path.join(input_directory, filename)\n",
    "            df = pd.read_csv(file_path)  # 跳过第一行并指定要读取的列\n",
    "            # 从后往前更新除了\"Date\"字段之外的其他字段\n",
    "            for i in range(len(df) - 2, -1, -1):\n",
    "                for column in df.columns:\n",
    "                    if column == 'Date':\n",
    "                        continue\n",
    "                    if column == 'openrank':\n",
    "                        continue\n",
    "                    next_value = df.iloc[i + 1, df.columns.get_loc(column)]  # 获取下一个字段值\n",
    "                    if pd.isnull(next_value):\n",
    "                        next_value = df[column].median()  # 使用中位数填充缺失值\n",
    "                    new_value = next_value * coef + df.iloc[i, df.columns.get_loc(column)]  # 计算新的字段值\n",
    "                    df.loc[i, column] = new_value  # 更新当前行的字段值\n",
    "            # 使用一列的中位数填充\n",
    "            df.fillna(df.median(), inplace=True)\n",
    "            if merged_df is None:\n",
    "                merged_df = df\n",
    "            else:\n",
    "                merged_df = pd.concat([merged_df, df], ignore_index=True)  # 合并DataFrame\n",
    "\n",
    "    # 将合并后的DataFrame保存为CSV\n",
    "    merged_csv_path = os.path.join(output_directory, 'merged_data.csv')\n",
    "    merged_df.to_csv(merged_csv_path, index=False)\n",
    "\n",
    "\n",
    "# 调用函数\n",
    "for coef in [0.1, 0.2, 0.3, 0.4, 0.5]:  # 使用你想要的系数\n",
    "    add_last_value('./out', './out_v2/', coef)\n",
    "\n",
    "## 获得cluster的数据集\n",
    "import os\n",
    "import pandas as pd\n",
    "\n",
    "# 读取cluster_results.csv文件\n",
    "cluster_df = pd.read_csv('cluster_results.csv')\n",
    "\n",
    "# 创建结果文件夹\n",
    "output_directory = './clustered_data_0.4'\n",
    "if not os.path.exists(output_directory):\n",
    "    os.makedirs(output_directory)\n",
    "\n",
    "# 遍历cluster_results.csv中的每一行\n",
    "for _, row in cluster_df.iterrows():\n",
    "    repository = row['Repository']\n",
    "    cluster = row['Cluster']\n",
    "    file_name = f\"{repository}\"\n",
    "    file_path = os.path.join('out_v1', file_name)\n",
    "    output_file_path = os.path.join(output_directory, f\"Cluster_{cluster}.csv\")\n",
    "\n",
    "    if os.path.exists(file_path):\n",
    "        # 读取CSV文件\n",
    "        df = pd.read_csv(file_path)\n",
    "        # 将数据保存到对应的Cluster文件中\n",
    "        with open(output_file_path, 'a', newline='') as f:\n",
    "            df.to_csv(f, index=False, header=f.tell() == 0)\n",
    "\n",
    "import os\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# 读取cluster_results.csv文件\n",
    "cluster_df = pd.read_csv('cluster_results.csv')\n",
    "\n",
    "# 创建结果文件夹\n",
    "output_directory = './clustered_data_0.4'\n",
    "if not os.path.exists(output_directory):\n",
    "    os.makedirs(output_directory)\n",
    "\n",
    "# 遍历cluster_results.csv中的每一行\n",
    "for _, row in cluster_df.iterrows():\n",
    "    repository = row['Repository']\n",
    "    cluster = row['Cluster']\n",
    "    file_name = f\"{repository}\"\n",
    "    file_path = os.path.join('out_v1', file_name)\n",
    "    output_file_path = os.path.join(output_directory, f\"Cluster_{cluster}.csv\")\n",
    "\n",
    "    if os.path.exists(file_path):\n",
    "        # 读取CSV文件\n",
    "        df = pd.read_csv(file_path)\n",
    "\n",
    "        # 从后往前更新除了\"Date\"和\"openrank\"字段之外的其他字段\n",
    "        coef = 0.4  # 设置系数\n",
    "        for i in range(len(df) - 2, -1, -1):\n",
    "            for column in df.columns:\n",
    "                if column in ['Date', 'openrank']:\n",
    "                    continue\n",
    "                next_value = df.iloc[i + 1, df.columns.get_loc(column)]  # 获取下一个字段值\n",
    "\n",
    "                # 使用中位数填充缺失值\n",
    "                if pd.isnull(next_value):\n",
    "                    next_value = df[column].median() if not pd.isnull(df[column].median()) else 0\n",
    "\n",
    "                new_value = next_value * coef + df.iloc[i, df.columns.get_loc(column)]  # 计算新的字段值\n",
    "                df.loc[i, column] = new_value  # 更新当前行的字段值\n",
    "\n",
    "        # 使用一列的中位数填充\n",
    "        for column in df.columns:\n",
    "            if column in ['Date', 'openrank']:\n",
    "                continue\n",
    "            df[column].fillna(df[column].median() if not pd.isnull(df[column].median()) else 0, inplace=True)\n",
    "\n",
    "        # 将数据保存到对应的Cluster文件中\n",
    "        with open(output_file_path, 'a', newline='') as f:\n",
    "            df.to_csv(f, index=False, header=f.tell() == 0)\n"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "data": {
      "text/plain": "                Repository  Cluster\n0           AdguardFilters        2\n1                  airbyte        1\n2                    nacos        1\n3                  angular        0\n4               components        2\n..                     ...      ...\n295                   yuzu        1\n296                 zephyr        2\n297  start-here-guidelines        1\n298                    zig        1\n299                  zulip        2\n\n[300 rows x 2 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Repository</th>\n      <th>Cluster</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>AdguardFilters</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>airbyte</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>nacos</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>angular</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>components</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>295</th>\n      <td>yuzu</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>296</th>\n      <td>zephyr</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>297</th>\n      <td>start-here-guidelines</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>298</th>\n      <td>zig</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>299</th>\n      <td>zulip</td>\n      <td>2</td>\n    </tr>\n  </tbody>\n</table>\n<p>300 rows × 2 columns</p>\n</div>"
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "pd.read_csv('./data/cluster_results.csv')\n"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-07-12T06:13:33.569510Z",
     "start_time": "2023-07-12T06:13:33.533220Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n",
      "/var/folders/pz/nmxfbcq936ndq57fkjbr5w5r0000gn/T/ipykernel_14670/1971944638.py:13: FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.\n",
      "  df = df.fillna(df.median())\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "def merge_csv_files(input_directory, output_file):\n",
    "    dfs = []\n",
    "    for filename in os.listdir(input_directory):\n",
    "        if filename.endswith('.csv'):\n",
    "            file_path = os.path.join(input_directory, filename)\n",
    "            df = pd.read_csv(file_path, skiprows=1, header=None, index_col=None)  # skip the first row\n",
    "\n",
    "            # Use the median of each column to fill missing values\n",
    "            df = df.fillna(df.median())\n",
    "\n",
    "            dfs.append(df)\n",
    "\n",
    "    if dfs:\n",
    "        # Concatenate all DataFrames using the concat function\n",
    "        merged_df = pd.concat(dfs, ignore_index=True)\n",
    "\n",
    "        # Reset the index\n",
    "        merged_df = merged_df.reset_index(drop=True)\n",
    "\n",
    "        # Add column names\n",
    "        column_names = ['Date', 'openrank', 'new_contributors', 'change_request_response_time_avg', 'issue_age_avg',\n",
    "                        'code_change_lines_sum', 'issues_new', 'issues_and_change_request_active',\n",
    "                        'code_change_lines_add', 'technical_fork', 'attention', 'issue_comments',\n",
    "                        'change_requests_accepted', 'change_request_age_avg', 'participants', 'bus_factor',\n",
    "                        'code_change_lines_remove', 'inactive_contributors', 'change_requests_reviews', 'activity',\n",
    "                        'change_request_resolution_duration_avg', 'issues_closed', 'change_requests',\n",
    "                        'issue_response_time_avg', 'issue_resolution_duration_avg', 'stars']\n",
    "\n",
    "        merged_df.columns = column_names\n",
    "\n",
    "        # Drop the \"Date\" column\n",
    "        merged_df = merged_df.drop(columns=['Date'])\n",
    "\n",
    "        # Save the merged DataFrame as a CSV\n",
    "        merged_df.to_csv(output_file, index=False)\n",
    "\n",
    "# Call the function\n",
    "merge_csv_files('data/out', 'merged.csv')\n"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-07-13T15:55:09.464305Z",
     "start_time": "2023-07-13T15:55:06.161983Z"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
